package com.unitd.base;

import com.unitd.base.module.comm.cache.RegionCacheUtil;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * SpringBoot方式启动类
 *
 * @author Hudan
 * @version 1.0
 * @filename ShopApplication.java
 * @copyright www.unitd.com
 * @date 2020-06-10
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.unitd.base.*.*.mybatis.mapper"})
@EnableTransactionManagement
@Slf4j
public class ShopApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShopApplication.class, args);
        log.info(ShopApplication.class.getSimpleName() + " is success!");
    }

    @Bean("regionCacheUtil")
    public RegionCacheUtil regionCacheUtil() {
        return new RegionCacheUtil();
    }
}